import mockRequest from '@/utils/mockRequest'
const state = {
  list: {}
}
const actions = {
  async getData(context) {
    let result = await mockRequest.get('/home/list')

    if (result.code === 20000) {
      // console.log(result);
      context.commit('GETDATA', result.data)
    }
  }
}
const mutations = {
  GETDATA(state, val) {
    state.list = val
  }
}

const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
